public class Animal {
    String name;
    int age;
    //父类的构造方法
    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat(){
        System.out.println("吃饭");
    }
}
class Dog extends Animal{
    String brand;//种类
    //子类的构造方法
    public Dog(String name, int age, String brand) {
        super(name, age);
        this.brand = brand;
    }

    public  void eat(){
        System.out.println("吃狗粮");
    }
}
